home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / icondr / icondemo.frm < prev    next >
Text File  |  1995-05-08  |  2KB  |  90 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   2895
  5.    ClientLeft      =   1170
  6.    ClientTop       =   1545
  7.    ClientWidth     =   5505
  8.    Height          =   3300
  9.    Left            =   1110
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   2895
  13.    ScaleWidth      =   5505
  14.    Top             =   1200
  15.    Width           =   5625
  16.    Begin Timer Timer1 
  17.       Interval        =   500
  18.       Left            =   120
  19.       Top             =   1200
  20.    End
  21.    Begin PictureBox Pic 
  22.       AutoRedraw      =   -1  'True
  23.       AutoSize        =   -1  'True
  24.       Height          =   510
  25.       Index           =   2
  26.       Left            =   1320
  27.       Picture         =   ICONDEMO.FRX:0000
  28.       ScaleHeight     =   480
  29.       ScaleWidth      =   480
  30.       TabIndex        =   2
  31.       Top             =   600
  32.       Width           =   510
  33.    End
  34.    Begin PictureBox Pic 
  35.       AutoRedraw      =   -1  'True
  36.       AutoSize        =   -1  'True
  37.       Height          =   510
  38.       Index           =   1
  39.       Left            =   720
  40.       Picture         =   ICONDEMO.FRX:0302
  41.       ScaleHeight     =   480
  42.       ScaleWidth      =   480
  43.       TabIndex        =   1
  44.       Top             =   600
  45.       Width           =   510
  46.    End
  47.    Begin PictureBox Pic 
  48.       AutoRedraw      =   -1  'True
  49.       AutoSize        =   -1  'True
  50.       Height          =   510
  51.       Index           =   0
  52.       Left            =   120
  53.       Picture         =   ICONDEMO.FRX:0604
  54.       ScaleHeight     =   480
  55.       ScaleWidth      =   480
  56.       TabIndex        =   0
  57.       Top             =   600
  58.       Width           =   510
  59.    End
  60. End
  61. Sub Form_Load ()
  62.  
  63. '-- show the form as an icon on startup
  64. WindowState = 1
  65.  
  66. End Sub
  67.  
  68. Sub Timer1_Timer ()
  69.  
  70. Static IconNumber
  71.  
  72. '-- we want IconNumber to be 0 to 3
  73. IconNumber = (IconNumber + 1) Mod 4
  74. Form1.Caption = "Icon" + Str$(IconNumber)
  75. If IconNumber = 3 Then '-- draw something instead of using an icon
  76.     '-- first, clear any icon
  77.     Form1.Icon = LoadPicture()
  78.     '-- now clear the picture
  79.     Form1.Picture = LoadPicture()
  80.     '-- set width of line to 4
  81.     DrawWidth = 4
  82.     Form1.Line (0, 0)-(530, 530), QBColor(14), B
  83.     Form1.Line (0, 0)-(530, 530), QBColor(12)
  84. Else '-- transfer an icon from one of the pictures on the form
  85.     Form1.Icon = Pic(IconNumber).Picture
  86. End If
  87.  
  88. End Sub
  89.  
  90.